
#include "Channel.hpp"
#include "EpollPoller.hpp"
#include "Poller.hpp"

namespace zephyr {

Poller::Poller(EventLoop *loop) : m_ownerloop(loop) {}

bool Poller::hasChannel(Channel *channel) const {
    auto it = m_channels.find(channel->fd());
    return it != m_channels.end() && it->second == channel;
}

Poller *Poller::newDefaultPoller(EventLoop *loop) {
    return  new EpollPoller(loop);
}

}